<?php
require_once('Vega/Dao/Table.php');

class Mobitv_CommonDao extends Vega_Dao_Table
{
	public function loadConfig()
    {
		$sql = 'SELECT * FROM config';
		$this->_db->query($sql);
		
		$data = Array();
		while ($row = $this->_db->fetchRow()) {
			$data[$row['name']] = $row['value'];
		}
		
		return $data;
	}

    public function getTransaction($from, $to)
    {
        $sql = "SELECT t.*
                FROM transaction t
                WHERE (t.action!='vod_watch' AND t.action!='vod_download') AND charge>0 AND t.created_time>='$from' AND t.created_time<'$to'
                ORDER BY t.created_time";
        $this->_db->query($sql);

        return $this->_db->fetchRowset();
    }
}